<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        img{
            width: 200px;
            height: 200px;
        }
    </style>
</head>
<body>
    <img src="images/1.jpg" alt="">
    <div>玩第一个</div>
    <script>
       var img =  document.querySelector('img');
       var div = document.querySelector('div');
       var date = new Date();//调用日期对象
       var h = date.getHours;
       if(h<12){
           img.src = 'images/1.jpg';
           div.innerHTML = '玩第一个';
       }else if(h<18){
           img.src = 'images/2.jpg';
           div.innerHTML = '玩第二个';
       }else{
           img.src = 'images/3.jpg';
           div.innerHTML = '玩第三个';
       }
       

    </script>
</body>
</html>